import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:glorysoft_mobile_plugin/tool/service/app_package_service.dart';
import 'package:glorysoft_mobile_plugin/tool/service/app_sp_service.dart';
import 'package:xin_nuo_pda/routes/Routes.dart';
import 'package:xin_nuo_pda/tab/TabsPage.dart';
import 'package:xin_nuo_pda/values/colors.dart';

import 'http/http_client.dart';
import 'http/http_config.dart';
import 'utils/string_extension.dart';
import 'values/constant.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await initServices();
  runApp(MyApp());
}

initServices() async {
  await Get.putAsync(() => AppSpService().init());
  await Get.putAsync(() => AppPackageService().init());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    Get.put(HttpClient(dioConfig: HttpConfig(baseUrl: BASE_URL,connectTimeout: 30000)));
    return GetMaterialApp(
      // home: Tabs(),
      initialRoute: Routes.Login,
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
          appBarTheme: AppBarTheme(
              backgroundColor: theme_blue.toColor(), centerTitle: true)),
      getPages: Routes.getPages,
      // home: TabsPage(),
    );
  }


}
